feel your data do not qualify, you can use an alternative called the Welch test (also called the

Welch t test, or the unequal-variance t test). As you see later in this chapter under “Surveying

Student t tests,” because the Welch test accounts for both equal and unequal variance, it is the only

one that is included in R statistical software.

Comparing the means of three or more groups of numbers

Comparing the means of three or more groups of numbers is an obvious extension of the two-group

comparison in the preceding section. For example, you may have recorded some biological

measurement, like a value indicating level of response to treatment among three diagnostic groups

(such as mild, moderate, and severe periodontitis). A comparison of the means of three or more groups

is handled by the analysis of variance (ANOVA), which we describe later in this chapter under

Assessing the ANOVA.” When there is one grouping variable, like severity of periodontitis, you have

a one-way ANOVA. If the grouping variable has three levels (like mild, moderate, and severe

periodontitis), it’s called a one-way, three-level ANOVA.

The null hypothesis of the one-way ANOVA is that all the groups have the same mean. The alternative

hypothesis is that at least one group has a mean that is statistically significantly different from at least

one of the other groups. The ANOVA produces a single p value, and if that p is less than your chosen

criterion (typically α = 0.05), you conclude that at least one of the means must be statistically

significantly different from at least one of the other means. (For a refresher on hypothesis testing and p

values, see Chapter 3.) But the problem with ANOVA is that if it is statistically significant, it doesn’t

tell you which groups have means that are statistically significantly different. If you have a statistically

significant ANOVA, you have to follow-up with one or more so-called post-hoc tests (described later

under “Assessing the ANOVA”), which test for differences between the means of each pair of groups

in your ANOVA.

You can also use the ANOVA to compare just two groups. However, this one-way, two-level ANOVA

produces exactly the same p value as the classic unpaired equal-variance Student t test.

Comparing means in data grouped on several different variables

The ANOVA is a very flexible method in that it can accommodate comparing means across several

grouping variables at once. As an example, you could use an ANOVA for comparing treatment

response among participants with different levels of the condition (such as mild, moderate, and severe

periodontitis), who come from different clinics (such as Clinic A and Clinic B), and have undergone

different treatment approaches (such as using mouthwash or not). An ANOVA involving three different

grouping variables is called a three-way ANOVA (and compares at a more granular level).

In ANOVA terminology, the term way refers to how many grouping variables are involved, and

the term level refers to the number of different levels within any one grouping variable.

Like the t test, the ANOVA also assumes that the value you are comparing follows a normal

distribution, and that the SDs of the groups you are comparing are similar. If your data are not normally

distributed, you can use the nonparametric Kruskal-Wallis test instead of the one-way ANOVA, which

we demonstrate later in the section “Running nonparametric tests.”